﻿using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.Extension;
using UnityEditor.UI;
using System;
using System.Extension;
using System.Reflection.Extension;
[CustomEditor(typeof(SubjectiveText)) ]
public class SubjectiveTextInspector : UnityEditor.UI.TextEditor
{
    SerializedProperty subject, key;
    protected override void OnEnable()
    {
        base.OnEnable();
        subject = serializedObject.FindProperty("m_subject");
        key = serializedObject.FindProperty("m_key");
    }

    public override void OnInspectorGUI()
    {
        serializedObject.Update();
        EditorGUILayout.PropertyField(subject);
        EditorGUILayout.PropertyField(key);
        serializedObject.ApplyModifiedProperties();
        base.OnInspectorGUI();
    }

    [MenuItem("GameObject/UI/Subjective/Text")]
    static void CreateSubjectiveText()
    {
        GameObjectMenu.CreateNewControlInHierarchy("Text", typeof(CanvasRenderer), typeof(SubjectiveText));
    }
   
}
